package com.example.myfirstandroidapp;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.EditText;
import android.widget.ImageButton;

public class MainActivity extends Activity implements OnClickListener {

	 EditText et = null;
     @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        ImageButton b = (ImageButton) findViewById(R.id.imageButton1);
        b.setOnClickListener(this); 
        
        et = (EditText) findViewById(R.id.editText1);
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }


		@Override
		public void onClick(View arg0) {
			// TODO Auto-generated method stub
			if (arg0.getId() == R.id.imageButton1) {
				Log.d("MARCO", "Testo di debug");
				Intent intent = new Intent(MainActivity.this, SecondActivity.class);
				intent.putExtra("thetext", et.getText());
				startActivity(intent);
		}
	}
    
}
